import { Module, Global } from '@nestjs/common';
import { AuthService } from './auth.service';
import { UsersModule } from '../users/users.module';
import { PassportModule } from '@nestjs/passport';
import { HttpStrategy } from './http.strategy';
import { JwtModule, JwtService } from '@nestjs/jwt';
import { jwtConstants } from './constants';
import { JwtStrategy } from './jwt.strategy';
@Global()
@Module({
  imports: [
    UsersModule,
     // 建立jsonwebtoken时的相关信息
    JwtModule.register({
      secret: jwtConstants.secret,
      // signOption可以在JwtModule设定
  }),
  ],
  providers: [
    AuthService,
    HttpStrategy,
    JwtStrategy
],
  exports: [AuthService]
})
export class AuthModule { }